package com.jiangsong.controller;


import com.jiangsong.service.ProductService;
import com.jiangsong.service.TestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController()
public class TestController {

    private static final Logger log = LoggerFactory.getLogger(TestController.class);
    @Autowired
    TestService testService;

    @Autowired
    ProductService productService;



    @GetMapping("/test")
    public Object test(@RequestParam String name) {
        System.out.println("testController#test#" + name);
        return testService.test(name);
    }


    @GetMapping("/insertProduct")
    public Object insertProduct(@RequestParam String accNo) {
        log.info("新增product controller开始,输入:{}", accNo);
        productService.createOneProduct(accNo, "e_mesg", "20240101");
        log.info("新增product controller结束,返回:{}", accNo);

        return accNo;
    }
}
